<template>
  <el-dialog :title="title"
             :close-on-click-modal="false"
             :visible.sync="addOrEditShow"
             width="680px"
             :before-close="handleClose">
    <el-form :model="dialogForm"
             :inline="true"
             label-position="top"
             ref="dialogForm"
             :rules="rules"
             label-width="100px">
      <el-form-item label="楼栋编号："
                    prop="number">
        <el-input v-model="dialogForm.number"
                  :min="0"
                  :maxlength="20"
                  size="small"
                  placeholder="请输入楼栋编号"></el-input>
      </el-form-item>
      <el-form-item label="楼层："
                    prop="totalFloor">
        <el-input v-model="dialogForm.totalFloor"
                  type="number"
                  size="small"
                  placeholder="请输入楼层"></el-input>
      </el-form-item>
      <!-- <el-form-item label="单元编号："
                    prop="area">
        <el-input v-model="dialogForm.area"
                  type="number"
                  size="small"
                  placeholder="请输入单元编号"></el-input>
      </el-form-item>
      <el-form-item label="房间类型："
                    prop="schoolAreaId">
        <el-select v-model="dialogForm.schoolAreaId"
                   size="small"
                   style="width: 200px"
                   placeholder="请选择">
          <el-option v-for="item in schoolList"
                     :key="item.value"
                     :label="item.label"
                     :value="item.value">
          </el-option>
        </el-select>
      </el-form-item> -->
      <el-form-item label="面向对象："
                    prop="objectOrientedId">
        <el-select v-model="dialogForm.objectOrientedId"
                   style="width: 200px"
                   size="small"
                   placeholder="请选择">
          <el-option v-for="item in typeList"
                     :key="item.id"
                     :label="item.value"
                     :value="item.id">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="面向性别："
                    prop="gender">
        <el-select v-model="dialogForm.gender"
                   style="width: 200px"
                   size="small"
                   placeholder="请选择">
          <el-option v-for="(item, index) in sexList"
                     :key="index"
                     :label="item"
                     :value="index">
          </el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="座机号："
                    prop="landlineNumber">
        <el-input v-model="dialogForm.landlineNumber"
                  size="small"
                  placeholder="请输座机号"></el-input>
      </el-form-item>
    </el-form>
    <span slot="footer"
          class="dialog-footer">
      <el-button @click="handleClose"
                 size="small">取 消</el-button>
      <el-button type="primary"
                 @click="addOrEditSure"
                 size="small">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
export default {
  props: {
    addOrEditShow: Boolean,
    dialogForm: Object,
    handleClose: Function,
    addOrEditSure: Function,
    typeList: Array,
    sexList: Array,
    title: String,
    rules: Object
  }
}
</script>
